package com.geekhale.validate.controller;

import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
public class User implements BaseRequest {
    @NotNull(message = "用户名不能为空")
    private String name;

    @NotNull(message = "密码不能为空")
    private String pwd;

    @Override
    public String validate() {
        if (name.equals(pwd)) {
            return "用户名密码不能相同";
        }
        return null;
    }
}
